<!--
 * @Description: 首页
 * @Date: 2024-02-02 11:16:50
 * @FilePath: \demod:\12electron\electron-vite-template\src\renderer\src\views\home\index.vue
-->
<template>
  <div class="container">
    <Versions />

    <div class="text-box">
      <el-input v-model="inputText" style="width: 240px" placeholder="请输入内容" />
      <el-button type="primary" @click="sendVoice">语音播报</el-button>
    </div>
  </div>
</template>

<script lang="ts" setup name="home">
import Versions from '@renderer/components/Versions.vue';
import { ref } from 'vue';
import { sendText } from '@renderer/api/common';

const inputText = ref('');

const ipcHandle = () => window.electron.ipcRenderer.send('ping');

const sendVoice = async () => {
  const { data } = await sendText({
    rate: 90,
    readText: inputText.value,
    volume: 90,
  });
  console.log('data: ', data);
};
</script>

<style lang="scss" scoped>
.container {
  padding: 10px;
  font-size: 20px;
  color: #191818;

  .text-box {
    margin-top: 10px;
    display: flex;
    flex-direction: row;
  }
}
</style>
